﻿<Window x:Class="SwiftTailer.Wpf.Pages.SettingsWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:SwiftTailer.Wpf.Pages"
        xmlns:viewModels="clr-namespace:SwiftTailer.Wpf.ViewModels"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        xmlns:commands="clr-namespace:SwiftTailer.Wpf.Commands"
        mc:Ignorable="d"
        Title="Settings" Height="300" Width="300"
        Name="ThisWindow" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">

    <Window.DataContext>
        <viewModels:SettingsViewModel />
    </Window.DataContext>

    <Window.Resources>
        <Style x:Key="Labels" TargetType="Label">
            <Setter Property="Width" Value="135" />
        </Style>
        <Style x:Key="TextInputs" TargetType="xctk:IntegerUpDown">
            <Setter Property="Width" Value="100"/>
        </Style>
    </Window.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="5">
            <Label Content="Maximum Read Length" Style="{StaticResource Labels}" />
            <xctk:IntegerUpDown Value="{Binding MaxReadLength, UpdateSourceTrigger=PropertyChanged, Delay=500, Mode=TwoWay}" 
                         Style="{StaticResource TextInputs}" />
            <Label Content="kb" />
        </StackPanel>
        <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="5">
            <Label Content="Maximum Display Lines" Style="{StaticResource Labels}"/>
            <xctk:IntegerUpDown Value="{Binding MaxDisplayLines, UpdateSourceTrigger=PropertyChanged, Delay=500, Mode=TwoWay}" 
                         Style="{StaticResource TextInputs}" />
            <Label Content="lines" />
        </StackPanel>
        <StackPanel Grid.Row="2" Orientation="Horizontal" Margin="5">
            <Label Content="Polling Interval" Style="{StaticResource Labels}"/>
            <xctk:IntegerUpDown Value="{Binding PollingInterval, UpdateSourceTrigger=PropertyChanged, Delay=500, Mode=TwoWay}" 
                         Style="{StaticResource TextInputs}" />
            <Label Content="ms" />
        </StackPanel>

        <Button Grid.Row="4" Height="25" Width="100" Margin="5" HorizontalAlignment="Right" Content="OK"
                Command="commands:StaticCommands.CloseWindowCommand" CommandParameter="{Binding ElementName=ThisWindow}"/>
    </Grid>
</Window>
